let g:python3_host_prog = '/Users/wx/.config/py/venv/bin/python3'
set encoding=utf-8
colorscheme desert

lua <<EOF 
return require('packer').startup(function(use)
  -- Packer can manage itself
  --use 'https://gitee.com/mirrors_wbthomason/packer.nvim'
  --use 'neoclide/coc.nvim'
  --use 'NeogitOrg/neogit'
  --use 'lewis6991/gitsigns.nvim'
  use 'wbthomason/packer.nvim'
  use 'https://gitee.com/mirrors_voldikss/vim-floaterm.git'
  use 'https://gitee.com/linuor/tabular.git'
  use 'https://gitee.com/oyaay/plenary.nvim.git'
  use 'https://gitee.com/neopack/nui.nvim.git'
  use 'https://gitee.com/nvim_lip/telescope.nvim.git'
  use 'https://gitee.com/nvim_lip/mini.nvim.git'
  use 'https://gitee.com/mirrors_cenkalti/vim-airline.git'
  use 'https://gitee.com/zgpio/LeaderF.git'
  use 'https://gitee.com/zgpio/nvim-treesitter.git'
  use 'https://gitee.com/mirrors_TimUntersberger/neogit.git'
  use 'https://gitee.com/nvpack/gitsigns.nvim.git'
  use 'https://gitee.com/nvim_lip/render-markdown.nvim.git'
  use 'https://gitee.com/logicdomain/coc.nvim.git'

end)

EOF
lua <<EOF
require('neogit').setup{
  dependencies = {
    "nvim-lua/plenary.nvim", -- 必需
    "sindrets/diffview.nvim", -- 可选 - Diff 集成
    "nvim-telescope/telescope.nvim", -- 可选
    "ibhagwan/fzf-lua", -- 可选
    "echasnovski/mini.pick", -- 可选
  },
  config = true
}
require('render-markdown').setup{
  after = { 'nvim-treesitter' },
  requires = { 'nvim-mini/mini.nvim.git'},     
  config = true
}

require('gitsigns').setup {
  signs_staged_enable = true,
  signcolumn = true,  -- Toggle with `:Gitsigns toggle_signs`
  numhl      = false, -- Toggle with `:Gitsigns toggle_numhl`
  linehl     = false, -- Toggle with `:Gitsigns toggle_linehl`
  word_diff  = false, -- Toggle with `:Gitsigns toggle_word_diff`
  watch_gitdir = {
    follow_files = true
  },
  auto_attach = true,
  attach_to_untracked = false,
  current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
  current_line_blame_opts = {
    virt_text = true,
    virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
    delay = 1000,
    ignore_whitespace = false,
    virt_text_priority = 100,
    use_focus = true,
  },
  current_line_blame_formatter = '<author>, <author_time:%R> - <summary>',
  sign_priority = 6,
  update_debounce = 100,
  status_formatter = nil, -- Use default
  max_file_length = 40000, -- Disable if file is longer than this (in lines)
  preview_config = {
    -- Options passed to nvim_open_win
    style = 'minimal',
    relative = 'cursor',
    row = 0,
    col = 1
  },
}
--require('template').setup{
--  temp_dir = '~/.config/nvim/template', -- template directory
--  author   = 'wangxiang',               -- your name
--  email    = 'wangxiang@bitintelligence.io', -- email address 
--}

EOF

set nu
set ruler
set ts=2
syntax on
filetype plugin on
set background=dark
colorschem desert

set autochdir
set expandtab
set wrap
set foldenable
set cursorcolumn
set cursorline
set incsearch
set showcmd
set nocp
set sw=2
set backspace=2
set ai
set guioptions-=T
set guioptions-=m
set guifont=Monaco:h15
set tags=tags
"set shell=bash
set foldmethod=marker
set foldmarker=//{,//}

"au BufNewFile,BufRead *.log *.rpt setf sim_log
au BufNewFile,BufRead *.sv *.svh setf systemverilog
au BufNewFile,BufRead *.py setf python

"airline
let g:airline_left_sep= '>'
let g:airline_right_sep = '<'
let g:airline_detect_modifield = 1
let g:airline_extensions = ['tabline']
let g:airline#extensions#tabline#show_splits = 1
let g:airline#extensions#tabline#show_tab_type = 1
let g:airline#extensions#tabline#alt_step = 1
let g:airline#extensions#tabline#show_tabs = 1
let g:airline#extensions#tabline#exclude_preview = 1
let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline#extensions#tabline#buffer_idx_mode = 1
let g:airline#extensions#tabline#tab_nr_type = 1
let g:airline#extensions#tabline#enbled = 1
let g:airline#extensions#tabline#show_buffers = 0
let g:airline#extensions#bufferline#enbled = 0
let g:airline#extensions#fugitiveline#enbled = 0

"map
nmap <leader>1 <Plug>AirlineSelectTab1
nmap <leader>2 <Plug>AirlineSelectTab2
nmap <leader>3 <Plug>AirlineSelectTab3
nmap <leader>4 <Plug>AirlineSelectTab4
nmap <leader>5 <Plug>AirlineSelectTab5
nmap <leader>6 <Plug>AirlineSelectTab6
nmap <leader>7 <Plug>AirlineSelectTab7
nmap <leader>8 <Plug>AirlineSelectTab8
nmap <leader>9 <Plug>AirlineSelectTab9

nmap <leader>t :FloatermToggle<cr>
nmap <c-n> :cn<cr>
nmap <c-p> :cp<cr>
nmap <c-s> <esc>:w<cr>
tnoremap<silent> <leader>t <c-\><c-n>:FloatermToggle<cr>
"tnoremap<silent> <leader>q <c-\><c-n>

"leaderf 
nmap <leader>m :LeaderfMru<cr>
let g:Lf_devIconsExactSymbols = { 'tags' : 'x'}
let g:Lf_devIconsExtensionSymbols = { 'sv' : 'x' ,'svh' :'x'}
